#include <stdio.h>
#include <unistd.h>
#include <string.h>

int main()
{
	printf("pid = %d\n",getpid());
	int *p = sbrk(4);
	*p = 100;
	printf("p = %p\n",p);        
	double *p1 = sbrk(8);
	*p1 = 3.14;
	printf("p1 = %p\n",p1);
	char *str = sbrk(10);
	strcpy(str, "hello");
	printf("str = %p\n",str);
	printf("p = %d , p1 = %lf , str = %s\n",*p, *p1, str);
        getchar();
	brk(p);
	brk(p1);
	brk(str);
        getchar();
	while(1);
}
